//
//  RootTabBarController.m
//  TeamInformatization
//
//  Created by bigger on 2019/3/31.
//  Copyright © 2019年 SPIC. All rights reserved.
//

#import "RootTabBarController.h"
#import "HomePageViewController.h"
#import "DocumentationViewController.h"
#import "PersonalCenterViewController.h"
#import "BaseNavigationController.h"

@interface RootTabBarController ()

@end

@implementation RootTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 控制器
    [self loadViewControllers];
    NSLog(@"修改一下嘛");
}

- (void)loadViewControllers
{
    NSDictionary *dictHome = [NSDictionary dictionaryWithObject:kSetRGBColor(204, 51, 51, 1) forKey:NSForegroundColorAttributeName];
    
    [[UITabBar appearance] setTranslucent:NO];
    
    
    // 主页
    HomePageViewController *homePageVC = [[HomePageViewController alloc] init];
    BaseNavigationController *homePageNC = [[BaseNavigationController alloc] initWithRootViewController:homePageVC];
    homePageNC.tabBarItem = [[UITabBarItem alloc] initWithTitle:nil image:[UIImage imageNamed:@"分组 29"] selectedImage:[UIImage imageNamed:@"分组 29"]];
    homePageNC.tabBarItem.title = @"首页";
    homePageNC.tabBarItem.selectedImage = [homePageNC.tabBarItem.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [homePageNC.tabBarItem setTitleTextAttributes:dictHome forState:UIControlStateSelected];
    
    
    // 文档资料
    DocumentationViewController *documentVC = [[DocumentationViewController alloc] init];
    BaseNavigationController *documentNC = [[BaseNavigationController alloc] initWithRootViewController:documentVC];
    documentNC.tabBarItem = [[UITabBarItem alloc] initWithTitle:nil image:[UIImage imageNamed:@"分组 30"] selectedImage:[UIImage imageNamed:@"分组 30"]];
    documentNC.tabBarItem.title = @"文档资料";
    documentNC.tabBarItem.selectedImage = [documentNC.tabBarItem.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [documentNC.tabBarItem setTitleTextAttributes:dictHome forState:UIControlStateSelected];
//    trainingNC.tabBarItem.tag = 1003;
    
    
    // 个人中心
    PersonalCenterViewController *personCenterVC = [[PersonalCenterViewController alloc] init];
    BaseNavigationController *personCenterNC = [[BaseNavigationController alloc] initWithRootViewController:personCenterVC];
    personCenterNC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"个人中心" image:[UIImage imageNamed:@"分组 31"] selectedImage:[UIImage imageNamed:@"分组 31"]];
    personCenterNC.tabBarItem.selectedImage = [personCenterNC.tabBarItem.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [personCenterNC.tabBarItem setTitleTextAttributes:dictHome forState:UIControlStateSelected];
    
    //    mineNC.tabBarItem.tag = 1004;
    
    
    self.viewControllers = @[homePageNC, documentNC, personCenterNC];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
